#!/bin/bash

# 定义实体类名称数组
entities=(
    "Admin"
    "Comment"
    "Follow"
    "Illustration"
    "IllustrationTag"
    "IllustrationCollection"
    "LikeIllustration"
    "LikeTag"
    "Message"
    "Order"
    "Product"
    "ProductImg"
    "Report"
    "ReportStatusLog"
    "Shop"
    "SubLevel"
    "SubLevelPricing"
    "Tag"
)

# 定义包路径
package_path="/"

# 确保目录存在
mkdir -p "$package_path"

# 遍历实体类名称数组并生成文件
for entity in "${entities[@]}"; do
    file_path="${package_path}/${entity}Mapper.java"
    cat > "$file_path" << EOF
package com.isoft.illustrationsdraw.mapper;

import com.isoft.illustrationsdraw.entity.${entity};
import org.apache.ibatis.annotations.Mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;

@Mapper
public interface ${entity}Mapper extends BaseMapper<${entity}> {

}
EOF
    echo "Created: $file_path"
done

echo "All Mapper files have been created successfully!"

